package cn.loan.service.impl;

import cn.loan.dao.CycleMapper;
import cn.loan.entity.Cycle;
import cn.loan.service.CycleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @Author: 毛苏宇
 * @Description: You can do it!
 * @Date: Create in 19:24 2019/3/21
 */
@Service
@Transactional(rollbackFor = Exception.class)
public class CycleServiceImpl implements CycleService {

    @Autowired
    private CycleMapper cycleMapper;

    @Override
    public List<Cycle> getAllCycle() {
        return cycleMapper.findAllCycle();
    }

    @Override
    public int getCycleNumber(int cycleNumber) {
        return cycleMapper.findByStages(cycleNumber);
    }
}
